<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0,user-scalable=no,minimal-ui">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../img/asset-favico.ico">
    <title>健康体检</title>
<!--    <script src="../js/jquery.min.js"></script>-->
    <script src="../js/axios-0.18.0.js"></script>
    <script src="../js/vue.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>

    <link rel="stylesheet" href="../css/page-health-report.css" />
</head>

<body data-spy="scroll" data-target="#myNavbar" data-offset="150">
    <div class="app">
        <!-- 页面头部 -->
        <div class="top-header">
            <span class="f-left" onclick="goBack()"><i class="icon-back"></i>返回</span>
            <span class="center">千锋健康</span>
            <span class="f-right"><i class="icon-more"></i></span>
        </div>
        <!-- 页面内容 -->
        <div class="contentBox">
            <div class="list-row3" id="t1">
<!--                <div class="report-item">-->
<!--                    <div class="item-name">-->
<!--                        <div class="info">-->
<!--                            <span class="name">{{张小花}}</span>-->
<!--                            <span class="sex">{{女}}</span>-->
<!--                        </div>-->

<!--                    </div>-->
<!--                    <div class="item-content">-->
<!--                        <ul class="box">-->
<!--                            <li>体检日期：<span>{{report.date}}</span></li>-->
<!--                            <li>档案号：<span>{{report.fileNumber}}</span></li>-->
<!--                            <li>体检套餐：<span>{{report.name}}</span></li>-->
<!--                            <li>上传时间：<span>{{report.uploadDate}}</span></li>-->
<!--                        </ul>-->
<!--                    </div>-->
<!--                    <div class="item-link">-->
<!--                        <a href="health1.html">-->
<!--                            体检报告-->
<!--                        </a>-->
<!--                    </div>-->
<!--                </div>-->
            </div>
        </div>
    </div>
    <script src="plugins/jquery/dist/jquery.min.js"></script>
<script>
    function c1() {
        window.location="health-index.html"
    }
    $.ajax({
        url:"report",
        headers:{
            //Bearer token的规范是：Authorization名称的头，值为Bearer空格+具体的jwt串
            "Authorization":"Bearer " + localStorage.getItem("token")
        },
        "success":function (data) {
            console.log(data.data)

            var mems = data.data;
            var str = "";
            for (let i = 0; i < mems.length; i++) {
                // console.log("12681481")
                str += "<div class=\"report-item\">\n" +
                    "                    <div class=\"item-name\">\n" +
                    "                        <div class=\"info\">\n" +
                    "                            <span class=\"name\">" + mems[i].name + "</span>\n" +
                    "                            <span class=\"sex\">" + mems[i].sex + "</span>\n" +
                    "                        </div>\n" +
                    "\n" +
                    "                    </div>\n" +
                    "                    <div class=\"item-content\">\n" +
                    "                        <ul class=\"box\">\n" +
                    "                            <li>体检日期：<span>" + mems[i].medical_date + "</span></li>\n" +
                    "                            <li>档案号：<span>" + mems[i].file_num + "</span></li>\n" +
                    "                            <li>体检套餐：<span>" + mems[i].setmeal_name + "</span></li>\n" +
                    "                            <li>上传时间：<span>" + mems[i].report_time + "</span></li>\n" +
                    "                        </ul>\n" +
                    "                    </div>\n" +
                    "                    <div class=\"item-link\">\n" +
                    "                        <a href=\"health1.html\">\n" +
                    "                            体检报告\n" +
                    "                        </a>\n" +
                    "                    </div>\n" +
                    "                </div>"


            }
            t1.innerHTML = str;
        }
    })


    let search = location.search;
    let m = search.split("=")[1];
    axios.defaults.withCredentials = true;

    function goBack(){
        location.href = "health-index.html";
    }

    // new Vue({
    //     el: "#app",
    //     data:{
    //         reports:null,
    //     },
    //     // mounted:function (){
    //     //     //在页面加载时就运行当前函数，查询当前member有几条report记录,并显示在页面上
    //     //     let that = this;
    //     //     axios.get("/healthReport/getAllReport?id=" + m)
    //     //     .then(function (data){
    //     //         let report = data.data;
    //     //         if(report.data.length==0){
    //     //             alert("没做过体检")
    //     //         }
    //     //         that.reports = report.data;
    //     //     });
    //     // },
    //     methods: {
    //         getDetail(id) {
    //             location.href = "health1.html?id=" + id;
    //         }
    //     }
    //
    // })
</script>


</body>